package com.tuanzi.loan.web.lazy.system;

import com.tuanzi.loan.business.service.system.DictionaryService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.system.DictionarySearchRequest;
import com.tuanzi.loan.vo.response.system.DictionarySearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class DictionaryLazyDataModel extends LazyDataSessionModel<DictionarySearchRequest, DictionarySearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private DictionaryService dictionaryService;

	public DictionaryLazyDataModel(DictionarySearchRequest searchRequest, CurrentUserBean session, DictionaryService dictionaryService) {
		super(searchRequest, session);
		this.dictionaryService = dictionaryService;
	}

	@Override
	protected Page<DictionarySearchResponse> doLoad0(PageSearcher<DictionarySearchRequest> pageSearcher) {
		return dictionaryService.list(pageSearcher);
	}
}
